import { createStore } from "vuex";
import getters from './getter'
import createPersistedState from 'vuex-persistedstate';
let modules = {}
const modulesFiles = import.meta.globEager('./modules/*.js')
for (const path in modulesFiles) {
    const moduleName = path.replace(/(.*\/)*([^.]+).*/gi, '$2')
    modules = { ...modules, [moduleName]: modulesFiles[path].default }
}
export default createStore({
    modules,
    getters,
    plugins: [createPersistedState({
        storage: window.sessionStorage,
        key: 'mango',
    })]
})